package com.spc.car.web.log;

public enum ProjectAction {
    ADD("新建项目", 1),
    UPDATE("修改项目", 2),

    ADD_TENDERING("新建招标项目", 10),
    UPDATE_TENDERING("更新招标项目", 11),
    UPDATE_TENDERING_TIME("更新招标项目时间", 12),
    CREATE_RELATION("关联项目", 13),
    CANCEL_RELATION("取消关联项目", 14),

    ADD_SECTION("新建招标项目标段", 20),
    UPDATE_SECTION("修改招标项目标段", 21),
    DISABLE_SECTION("停用招标项目标段", 22),

    ADD_MEMBER("添加项目人员", 30),
    REMOVE_MEMBER("删除项目人员", 31),
    UPDATE_MEMBER("更新项目人员", 32),

    ADD_DOC("添加项目文档", 40),
    UPDATE_DOC("更新项目文档", 41),
    DELETE_DOC("删除项目文档", 42),

    UPLOAD_ATTACHMENT("上传附件", 50),
    REMOVE_ATTACHMENT("移除附件", 51);

    private int index;
    private String name;

    ProjectAction(String name, int index) {
        this.name = name;
        this.index = index;
    }

    public static String getName(int index) {
        for (ProjectAction c : ProjectAction.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }

    public int getGroup() {
        return index/10;
    }
}
